<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="/WEB-INF/jsp/include/easyui.jsp" %>
<%@ include file="/WEB-INF/jsp/include/pForm.jsp" %>
<%@ include file="/WEB-INF/jsp/include/easyui-layui-upload.jsp" %>
<title>订单记录查看</title>
<script>
$(function(){
	fn.isTab = true;
	fn.resetForm();
	fn.readOnly();
	
	fn.bindTabButton("#form_butons a");
	
	/*通过编号加载*/
	var _pNo = '${param.pNo}' || '';
	if(_pNo && _pNo!=''){
		/*分包合同查询*/
		var subContract = '${param.subContract}';
		if(subContract=='true'){
			var param = {pNo: _pNo,pNo_searchType:'eq'};
			$.getJSON('/console/com.fs.jzzn.pojo.Information/json', param , function(obj){
				if(obj && obj.subcontract && obj.subcontract!='' ){
					var param = {contractNo:obj.subcontract,contractNo_searchType:'eq'};
					$.getJSON('/console/com.fs.jzzn.pojo.Contract/json', param , function(data){
						if(data){ $('#easyuiForm').form("load",data); }
					}); 
				}
			}); 
		}else{
			var param = {pNo: _pNo,pNo_searchType:'eq'};
			$.getJSON('/console/com.fs.jzzn.pojo.Project/json', param , function(obj){
				if(obj){
					var param = {contractNo:obj.contractNo,contractNo_searchType:'eq'};
					$.getJSON('/console/com.fs.jzzn.pojo.Contract/json', param , function(data){
						if(data){ $('#easyuiForm').form("load",data); }
					}); 
				}
			}); 
		}
	}
	setTimeout(function(){
		$("input[textboxname=remark]").prev().css({"line-height":"60px"});
	},200);
});
</script>
</head>
<body>
	<div class="easyui-panel" data-options="fit:true,border:false" style="padding:10px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center',border:false" style="padding:2px">
					<!-- 替换自动form表单 -->
		<form id="easyuiForm" method="post" action="#"  style="width:750px; ">
		 <!--类名属性及默认主键id-->
		<div style="margin-bottom:20px">
			<input class="easyui-textbox easyui-validatebox" name="contractName" style="width:725px;" data-options="label:'订单名称:' ,required:true" />
		 </div>
		 
		  <div style="margin-bottom:20px">
		  	<input class="easyui-textbox easyui-validatebox" name="contractNo" style="width:485px;" data-options="label:'订单编号:',validType:'length[0,45]'" />
		  	<input class="easyui-datebox easyui-validatebox" name="signDate" style="width:240px;" data-options="label:'签订日期:'" />
		 </div>
		 
		 <div style="margin-bottom:20px">
		 	<input class="easyui-textbox" id="outContractNo" name="outContractNo" style="width:240px;" readonly="readonly" data-options="label:'内部合同编号:',required:false,validType:['length[0,45]']" />
		   	<select class="easyui-combotreegrid" name="orgNo" style="width:240px;" data-options="label:'组织结构:',panelWidth:300,panelWidth:450,required:false,
	           	idField: 'orgNo', 
		   		missingMessage:'必填项',
				treeField: 'orgName',
				sortName:'orgOrder',
				onSelect:function(row){
					$('input[name=department]').val(row.orgName);	    
				},
				sortOrder:'asc',
	            url:'/console/com.fs.base.pojo.Org/list', 
	            queryParams:{isTreeGrid:'true', treeId:'id', treePid:'parentId' },
	            columns:[[    
	                {field:'orgName',			width:190,	title:'组织名称' }
		         	,{field:'orgType',			width:70,	title:'分类' }
		         	,{field:'orgNo',				width:100,	title:'组织编码' }
		         	,{field:'orgLeaderName',	width:70,	title:'负责人'}
	            ]]"></select>
		   	
			 <input class="easyui-textbox easyui-validatebox" name="url" style="width:240px;" data-options="label:'云储存:' ,required:false" />
		 </div>
		 
		  <div style="margin-bottom:20px">
		  <input class="easyui-textbox easyui-validatebox" name="partA" style="width:240px;" data-options="label:'合同甲方:',required:false" />
		  <input class="easyui-textbox easyui-validatebox" name="partAuser" style="width:240px;" data-options="label:'甲方经办人:' ,required:false" />
		  <input class="easyui-textbox easyui-validatebox" name="partAphone" style="width:240px;" data-options="label:'甲方电话:',required:false" />
		 </div>
		 
		  <div style="margin-bottom:20px">
		  <input class="easyui-textbox easyui-validatebox" name="partB" style="width:240px;" data-options="label:'合同乙方:',required:false" />
		  <input class="easyui-textbox easyui-validatebox" name="partBuser" style="width:240px;" data-options="label:'乙方经办人:' ,required:false" />
		  <input class="easyui-textbox easyui-validatebox" name="partBphone" style="width:240px;" data-options="label:'乙方电话:' ,required:false" />
		 </div>
		 
		 <div style="margin-bottom:20px">
		 	<select class="easyui-combobox" name="mainUnit" style="width:240px;" data-options="label:'总包单位:' ,required:false" 
				url="/console/combobox?valueField=name&textField=name&modleName=assistUnit&type=总包单位&type_searchType=eq" >
		 	</select>
		  	<select class="easyui-combobox" name="assistUnit" style="width:240px;" data-options="label:'分包单位:' ,required:false" 
				url="/console/combobox?valueField=name&textField=name&modleName=assistUnit&type=分包单位&type_searchType=eq" >
		 	</select>
		 	<input class="easyui-textbox easyui-validatebox" name="payDesc" style="width:240px;" data-options="label:'付款情况:'" />
		 </div>
		  
		 <div style="margin-bottom:20px">
			  	<select id="contractType" class="easyui-combobox" name="contractType" style="width:240px;" data-options="label:'合同类型:' ,required:false" 
					url="/console/combobox?valueField=dicName&textField=dicName&modleName=dictionary&pCode=B6&pCode_searchType=eq" >
			   	</select>
			   	
			   	<select class="easyui-combobox" name="contractLevel" style="width:240px;" data-options="label:'合同级别:',required:false">
			   		<option value="合同">合同</option>
			   		<option value="框架协议">框架协议</option>
				    <option value="子订单">子订单</option>
			   	</select>
		  		<input class="easyui-textbox easyui-validatebox" name="remark" multiline="true" style="width:240px;height:60px;" data-options="label:'备注:',required:false,validType:'length[0,500]'" />
		 </div>
		 
		 <div style="margin-bottom:20px">
		 	<input class="easyui-layuiupload" name="attachment" style="width:725px;" data-options="label:'附件:',upload:{auto:false,height:250,readonly:true}" />
		 </div>
		</form>
			</div>
			<div data-options="region:'south',split:false,collapsible:false" style="height:40px;">
				<div style="padding:5px 20px;text-align: right;background: #F4F4F4;border-width: 1px;border-style: solid;border-color: #dddddd #95B8E7 #95B8E7 #95B8E7;" id="form_butons">
					<a href="javascript:void(0)" id="f_btn_close" class="easyui-linkbutton" data-options="iconCls:'icon-no'"  style="width:80px">关闭</a>  
				</div>
			</div>
		</div>
	</div>
</body>
</html>